;;; $Id: eval.sld 200 2013-07-17 01:48:39Z alan.watson.f $

(define-library (oaxaca eval)

  (export eval
          environment)

  (import (scheme base)
          (scheme case-lambda)
          (prefix (scheme eval) scheme:))

  (import (oaxaca repl))

  (begin

    ;; This library mirrors the (scheme eval) library, except that the
    ;; environment argument to the eval procedure can be omitted, in
    ;; which case the environment returned by the
    ;; interactive-environment procedure exported by the (oaxaca repl)
    ;; library is used.

    (define eval
      (case-lambda
       ((expression)
        (scheme:eval expression (interaction-environment)))
       ((expression environment)
        (scheme:eval expression environment))))

    (define environment scheme:environment)))

